In laboratories of a certain company a new material called politoksyparen is tested.
During the researches an interesting property has been discovered.
A simple rod made of this material after being heated lengthens and bends so that it changes into an circular arc based on a chord,
which is the shape of the rod at the beginning (this property concerns only rods of short diameters).
Let's assume that
rods with very short diameters and lengths
(
)
were used to verify this property, and while being heated they lengthened respectively
by
(
), where
.
As a unit we take one millimeter.
Write a program that:
, their lengths
and increases in lengths
,
from the exact result,
In the first line of the standard input there is written one positive integer
(
).
In each of the following
lines there are written two integers separated by a single space —
the original length of the rod
and its increase in length during heating
.
In each of
lines of the standard output there should be written one nonnegative integer.
The integer in
-th line should be equal to the distance between the positions of the middle
of the
-th rod before and after heating computed with a required accuracy.
For the input data:
2 1000 20 15000 10
the correct result is:
87 237
Task author: Piotr Chrzastowski-Wachtel.
W razie problemów technicznych ze Szkopułem, prosimy o kontakt mailowy pod adresem szkopul@fri.edu.pl.
Jeśli chciałbyś porozmawiać o zadaniach, rozwiązaniach lub problemach technicznych, odwiedź nasze serwery na Discordzie. Są one moderowane przez społeczność, ale członkowie zespołu wsparcia również aktywnie się tam udzielają.